{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_jypx/template/public/ygcss.css">
<style type="text/css">
    input[type="radio"] + label::before {
        content: "\a0"; /*不换行空格*/
        display: inline-block;
        vertical-align: middle;
        font-size: 16px;
        width: 1em;
        height: 1em;
        margin-right: .4em;
        border-radius: 50%;
        border: 2px solid #ddd;
        text-indent: .15em;
        line-height: 1; 
    }
    input[type="radio"]:checked + label::before {
        background-color: #44ABF7;
        background-clip: content-box;
        padding: .1em;
        border: 2px solid #44ABF7;
    }
    input[type="radio"] {
        position: absolute;
        clip: rect(0, 0, 0, 0);
    }
    .ygmargin{margin-top: 10px;color: #999;}
</style>
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>    
    <li><a href="{php echo $this->createWebUrl('coursecate')}">学级列表</a></li>
    <li class="active"><a href="{php echo $this->createWebUrl('addcoursecate')}">添加学级</a></li>
</ul>
<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" id="invitative">
        <div class="panel panel-default ygdefault">
            <!-- <div class="panel-heading wyheader">
                学级管理&nbsp;>&nbsp;添加/编辑学级
            </div> -->
            <div class="panel-body">

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">校区名称</label>
                    <div class="col-sm-9">
                        <!-- <input type="text" name="cate_name" class="form-control" value="{$info['cate_name']}" /> -->
                    <select name="cate_name">
                        {loop $cates $item}
                        <option value="{$item['id']}" {if $item['id'] == $info['school_id']}selected {/if}> {$item['cate_name']}</option>
                        {/loop}
                        </select>
                    </div>
                </div>
                <!--      <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">图标</label>
                    <div class="col-sm-9">
                        {php echo tpl_form_field_image('img', $info['img'])}
                    </div>
                </div> -->
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">学级名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="course_name" class="form-control" value="{$info['course_name']}" />
                    </div>
                </div>
               
                <!-- <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>
                    <div class="col-sm-9">
                        <input type="text" name="sort" class="form-control" value="{$info['sort']}" />
                    </div>
                </div> -->
            </div>
        </div>


        <div class="form-group">
            <input type="submit" name="submit" value="提交" class="btn col-lg-3" style="color: white;background-color: #44ABF7;"/>
            <input type="hidden" name="token" value="{$_W['token']}" />
            <input type="hidden" name="id" value="{$info['id']}" />
        </div>
    </form>
</div>
<script type="text/javascript">
    $(function(){
        // $("#frame-2").addClass("in");
        $("#frame-11").show();
        $("#yframe-11").addClass("wyactive");
        "{if $info}"
            "{if $info['item']=='1'}"
                $('.ygyi2').hide();
                $('.ygyi3').hide();
            "{/if}"
            "{if $info['item']=='2'}"
                $('.ygyi1').hide();
                $('.ygyi3').hide();
            "{/if}" 
            "{if $info['item']=='3'}"
                $('.ygyi1').hide();
                $('.ygyi2').hide();
            "{/if}"            
        "{else}"
            $('.ygyi2').hide();
            $('.ygyi3').hide();
        "{/if}"
        $("select#type").change(function(){
            if($(this).val()=='1'){
                console.log($(this).val())
                $(".ygyi1").show();
                $(".ygyi2").hide();
                $(".ygyi3").hide();  
            }else if($(this).val()=='2'){
                console.log($(this).val())
                $(".ygyi1").hide();
                $(".ygyi2").show();
                $(".ygyi3").hide();  
            }else if($(this).val()=='3'){
                console.log($(this).val())
                $(".ygyi1").hide();
                $(".ygyi2").hide();
                $(".ygyi3").show();  
            }
         })
    })
</script>